package com.joinway.framework.data.jdbc.repository.stub

import groovy.sql.Sql

import com.joinway.framework.data.jdbc.repository.TableRepository

class RepositoryTestClient {

//	final static String HOST = "localhost"
//	final static String DB = "testdb"
//	final static String UID = "test"
//	final static String PWD = "test123"

	final static String HOST = "localhost"
	final static String DB = "jiayida"
	final static String UID = "jiayida"
	final static String PWD = "group123"
	
	final static Sql sqlClient = Sql.newInstance("jdbc:mysql://$HOST:3306/$DB?autoReconnect=true&useUnicode=true&characterEncoding=utf-8", UID, PWD, 'com.mysql.jdbc.Driver');
	final static TableRepository repository = new TableRepository(sqlClient)
		
	static main(args) {
		test1()
	}

	static void test1(){
		def (domain) = repository.findByLoginNameAndPassword(AdminUser.class, "lee", "91087cdbfa199895f4df24f6e512e229")
		println domain
	}
}
